package org.wendu.wdoa.recrep.dao;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.wendu.wdoa.common.CurrentUser;
import org.wendu.wdoa.common.page.PageParam;
import org.wendu.wdoa.newassi.dto.TaskRecDto;
import org.wendu.wdoa.recrep.dto.TRqueryDto;
import org.wendu.wdoa.recrep.model.TackRec;

import java.util.List;
@Mapper
public interface TaskRecDao {
     List<TackRec> getTaskRecList(@Param("userId") String userId, @Param("pageParam") PageParam pageParam);

     @Update("update t_task_rec set tr_receive_date=#{tr_receive_date},tr_status=#{tr_status} where tr_id=#{tr_id}")
     void receiveTask(TRqueryDto tRqueryDto);

     @Select("select t.task_title,t.task_details from t_task t left join t_task_rec tr on t.task_id = tr.task_id where e_id=#{userId} and tr.task_id=#{task_id}")
     List<TackRec> getTaskInformation(@Param("userId") String userId,@Param("task_id") String task_id);

     @Update("update t_task_rec set tr_submit_date=#{tr_submit_date},tr_status=#{tr_status},tr_check_task=#{tr_check_task} where tr_id=#{tr_id}")
     void submitTask(TaskRecDto taskRecDto);
}
